翻訳と辞書
Words near each other
・ Liangxiang University Town Station
・ Liangxiang University Town West Station
・ Liangxiang, Beijing
・ Liangxiangnanguan Station
・ Liangxidaqiao Station
・ Liangxiongdiyu
・ Liangyuan District
・ Liangzhou District
・ Liangzhu
・ Liangzhu (town)
・ Liangzhu culture
・ Liangzhu Museum
・ Liangzhu Station
・ Liangzi Lake
・ Liangzihu District
Liang–Barsky algorithm
・ Lianhang Road Station
・ Lianhe
・ Lianhe Wanbao
・ Lianhe Zaobao
・ Lianhu District
・ Lianhu railway station
・ Lianhua
・ Lianhua County
・ Lianhua Dam
・ Lianhua Film Company
・ Lianhua North Station
・ Lianhua Road Station
・ Lianhua Supermarket
・ Lianhua Symphony


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Liang–Barsky algorithm : ウィキペディア英語版
Liang–Barsky algorithm
In computer graphics, the Liang–Barsky algorithm (named after You-Dong Liang and Brian A. Barsky) is a line clipping algorithm. The Liang–Barsky algorithm uses the parametric equation of a line and inequalities describing the range of the clipping window to determine the intersections between the line and the clipping window. With these intersections it knows which portion of the line should be drawn. This algorithm is significantly more efficient than Cohen–Sutherland.The idea of the Liang-Barsky clipping algorithm is to do as much testing as possible before computing line intersections.
Consider first the usual parametric form of a straight line:
:x = x_0 + u (x_1 - x_0) = x_0 + u \Delta x\,\!
:y = y_0 + u (y_1 - y_0) = y_0 + u \Delta y\,\!
A point is in the clip window, if
:x_}\,\!
and
:y_}\,\!,
which can be expressed as the 4 inequalities
:u p_k \le q_k, \quad k = 1, 2, 3, 4\,\!,
where
:p_1 = -\Delta x , q_1 = x_0 - x_} - x_0\,\! (right)
:p_3 = -\Delta y , q_3 = y_0 - y_\text\,\! (bottom)
:p_4 = \Delta y , q_4 = y_\text - y_0\,\! (top)
To compute the final line segment:
# A line parallel to a clipping window edge has p_k = 0 for that boundary.
# If for that k, q_k < 0, the line is completely outside and can be eliminated.
# When p_k < 0 the line proceeds outside to inside the clip window and when p_k > 0, the line proceeds inside to outside.
# For nonzero p_k, u = \frac gives the intersection point.
# For each line, calculate u_1 and u_2. For u_1, look at boundaries for which p_k < 0 (i.e. outside to inside). Take u_1 to be the largest among \left\ \right\}. For u_2, look at boundaries for which p_k > 0 (i.e. inside to outside). Take u_2 to be the minimum of \left\ \right\}. If u_1 > u_2, the line is outside and therefore rejected.
==See also==
Algorithms used for the same purpose:
* Cyrus–Beck
* Nicholl–Lee–Nicholl
* Fast-clipping

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Liang–Barsky algorithm」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.